<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>告警属性</title>
	<meta name="decorator" content="default"/>
	<tags:import includes="spinner,bootbox,form,datepicker,datepickerCss"></tags:import>
	<script src="${ctxStatic}/modules/alarm/alarmprop.js"></script>	
	<script src="${ctxStatic}/modules/alarm/alarmhist.js"></script>	
	<script type="text/javascript">
		var _ctx = '${ctx}';
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
			return false;
		}
	</script>
</head>
<body>
	<br>
	<form:form id="searchForm" modelAttribute="alarmprop" width="100%" action="${ctx}/alarm/alarmhist/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>		
	    <div class="control-group">
	        <span class="span3">
	            <label class="control-label" for="form-field-5">站&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;点：</label>
	        </span>	        
	        &nbsp;
	        <span class="span3">
	          <label>
	            <select id="siteSel" class="easyui-combobox" style="width:160px;" name="nenode.site.sid">
	                 <option value="0" selected>ALL</option>
	                 <c:forEach items="${slist}" var="siteinfo">
	                   <c:if test="${siteinfo.sid==ahist.nenode.site.sid}">
	                     <option value="${siteinfo.sid}" selected>${siteinfo.sname}</option>
	                   </c:if>
	                   <c:if test="${siteinfo.sid!=ahist.nenode.site.sid}">
	                     <option value="${siteinfo.sid}">${siteinfo.sname}</option>
	                   </c:if>	                   
	                 </c:forEach>
	            </select>
	          </label>
	        </span>
	        &nbsp;
	        <span class="span3" align="center">
<!-- 	          <button id="btn_query" class="btn btn-info"> -->
<!-- 	        	查  询 -->
<!-- 	      	  </button> -->
        <button id="btn_query" class="btn btn-success" type="submit" onclick="this.form.submit();">查询</button>
	        </span>
	        &nbsp;
	        <span class="span3">
              <a href="javascript:onStat()" class="btn btn-info">统  计</a>
	        </span>	  	        
	    </div>
          <br>
	    <div class="control-group">
	        <span class="span3">
	            <label class="control-label" for="form-field-5">网元标识：</label>
	        </span>	  
	           &nbsp;
	        <span class="span3">
	          <label>
	            <select id="neSel" class="easyui-combobox" style="width:160px;" name="nenode.nid">
	                <option value="0" selected>ALL</option>
	                <c:forEach items="${nelist}" var="neinfo">
	                   <c:if test="${neinfo.nid==ahist.nenode.nid}">
 	                     <option value="${neinfo.nid}" selected>${neinfo.ip}</option>
 	                   </c:if>
	                   <c:if test="${neinfo.nid!=ahist.nenode.nid}">
 	                     <option value="${neinfo.nid}">${neinfo.ip}</option>
 	                   </c:if> 	                   
 	                </c:forEach>
	            </select>
	          </label>
	        </span>
	        &nbsp;
	        <span class="span3">
	            <label class="control-label" for="form-field-5">机&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;盘：</label>
	        </span>	    
	           &nbsp;
	        <span class="span3">
	          <label>
	            <select id="slotSel" class="easyui-combobox" style="width:160px;" name="slot.card.cardtype.id">
	                <option value="0" selected>ALL</option>
	                <c:forEach items="${slotlist}" var="slot">
	                    <c:if test="${slot.card.cardid==ahist.slot.card.cardtype.id}">
 	                      <option value="${slot.card.cardid}" selected>${slot.num}：${slot.card.cardtype.cardtype}</option>
 	                    </c:if>
	                    <c:if test="${slot.card.cardid!=ahist.slot.card.cardtype.id}">
 	                      <option value="${slot.card.cardid}">${slot.num}：${slot.card.cardtype.cardtype}</option>
 	                    </c:if> 	                    
 	                </c:forEach>
	            </select>
	          </label>
	        </span>
	    </div>
	    <br>
	    <div class="control-group">
	        <span class="span3" align="center">
	            <label class="control-label" for="form-field-5">严重程度：</label>
	        </span>	
	        &nbsp;
	        <span class="span3">
	          <label>
	            <select class="easyui-combobox" style="width:160px;" name="severity.id">
	                <option value="0" selected>ALL</option>
	                <c:forEach items="${selist}" var="seinfo">
	                  <c:if test="${seinfo.id==ahist.severity.id}">
	                    <option value="${seinfo.id}" selected>${seinfo.severity}</option>
	                  </c:if>
	                   <c:if test="${seinfo.id!=ahist.severity.id}">
	                    <option value="${seinfo.id}">${seinfo.severity}</option>
	                  </c:if>	                  
	                </c:forEach>
	            </select>
	          </label>
	        </span>
	        &nbsp;
	        <span class="span3" align="center">
	            <label class="control-label" for="form-field-5">告警类型：</label>
	        </span>	
	        &nbsp;
	        <span class="span3">
	          <label>
	        	<select class="easyui-combobox" style="width:160px;" name="atype.aid">
	                <option value="0" selected>ALL</option>
	                <c:forEach items="${atlist}" var="atype">
	                   <c:if test="${atype.aid==ahist.atype.aid}">
	                     <option value="${atype.aid}" selected>${atype.alarmdesc}</option>
	                   </c:if>
	                   <c:if test="${atype.aid!=ahist.atype.aid}">
	                     <option value="${atype.aid}">${atype.alarmdesc}</option>
	                   </c:if>	                   
	                </c:forEach>
	            </select>
	          </label>
	        </span>
	    </div>	
	    <br>
	    <div class="control-group">
	        <span class="span3">
	            <label class="control-label" for="form-field-5">开始时间：</label>
	        </span>
	         &nbsp;
	        <span class="span3">
	         <input id="btimes" type="text" name="btimes" htmlEscape="false" maxlength="20" style="width:160px;" class="input-medium emsTimePicker" value="${ahist.btimes}"/>
            </span>	         
	         
<!--             <div id="datetimepicker" class="input-append date span3" align="left"> -->
<%--                <input id="btimes" class="span2" type="text" style="height:22px;" name="btimes" readonly value="${ahist.btimes}"></input> --%>
<!--                <span class="add-on" style="height:22px;"> -->
<!--                  <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> -->
<!--                </span> -->
<!--              </div> -->
              &nbsp;
	        <span class="span3">
	            <label class="control-label" for="form-field-5">结束时间：</label>
	        </span>
	         &nbsp;
<!--             <div id="datetimepicker1" class="input-append date span3"> -->
<%--                <input id="etimes" class="span2" type="text" style="height:22px;" name="etimes"  readonly value="${ahist.etimes}"></input> --%>
<!--                <span class="add-on" style="height:22px;"> -->
<!--                  <i data-time-icon="icon-time" data-date-icon="icon-calendar"></i> -->
<!--                </span> -->
<!--              </div> -->
           <span class="span3">
              <input id="etimes" type="text" name="etimes" htmlEscape="false" maxlength="20" style="width:160px;" class="input-medium emsTimePicker" value="${ahist.etimes}"/>
           </span>	
	    </div> 	    
	     <br>
	    <div class="control-group">
	     <span class="span12" align="left" valign="bottom" style="height:38px;">
			  <label>
			    <c:if test="${ahist.timetype=='adate'}"> 
				  <input name="timetype" type="radio" checked value="adate"/>
				</c:if>
			    <c:if test="${ahist.timetype!='adate'}"> 
				  <input name="timetype" type="radio" value="adate"/>
				</c:if>				
				<span class="lbl">确认时间</span>
			  </label>
			  &nbsp;
 			  <label>
                <c:if test="${ahist.timetype=='cdate'}"> 			  
				  <input name="timetype" type="radio" checked value="cdate"/>
				</c:if>
				<c:if test="${ahist.timetype!='cdate'}">
				  <input name="timetype" type="radio" value="cdate"/>
				</c:if>
				<span class="lbl">发生时间</span>
			  </label>
			  &nbsp;
 			  <label>
 			    <c:if test="${ahist.timetype=='rdate'}"> 
				  <input name="timetype" type="radio" checked value="rdate"/>
				</c:if>
 			    <c:if test="${ahist.timetype!='rdate'}"> 
				  <input name="timetype" type="radio" value="rdate"/>
				</c:if>				
				<span class="lbl">恢复时间</span>
			  </label>
		   </span>  
	    </div> 
	    <br>
    </form:form>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">		
	<thead>
		<tr>
<!-- 		<th class="center" style="width: 50px;"> -->
<!-- 		<label>  -->
<!-- 		 <input	type="checkbox" class="ace" /> <span class="lbl"></span> -->
<!-- 		</label> -->
<!-- 		</th> -->

		<th class="center">站点</th>
		<th class="center">网元标识</th>
		<th class="center">槽位</th>
		<th class="center">板卡</th>		
		<th class="center">严重程度</th>
		<th class="center">告警类型</th>
		<th class="center">发生时间</th>
<!-- 		<th>板卡编号</th> -->
        <th class="center">当前状态</th>
		</tr>
	</thead>
	<tbody>
	  <c:forEach items="${pages.list}" var="ainfo">
		<tr>
<!-- 		 <td class="center"> -->
<!-- 			<label> -->
<%-- 				<input value="${prop.id}" type="checkbox" class="ace" />  --%>
<!-- 				<span class="lbl"></span> -->
<!-- 			</label> -->
<!-- 		  </td> -->
         
          <td class="center">${ainfo.nenode.site.sname}</td>
          <td class="center">${ainfo.nenode.ip}</td>
          <td class="center">${ainfo.slot.num}</td>
          <td class="center">${ainfo.slot.card.cardname}</td>          
		  <td class="center">${ainfo.severity.severity}</td>
          <td class="center">${ainfo.atype.alarmdesc}</td>
          <td class="center">${ainfo.adate}</td>
<!--           <td>_temp</td> -->
          <td class="center">${ainfo.status.stsid eq 1?'已确认':'已恢复'}</td>
		 </tr>
	   </c:forEach>
	</tbody>
	</table>	
	${pages}
	
 	<div id="modalTable" action="new" class="modal fade" tabindex="-1" style="display:none;">
		<div class="modal-dialog">
			<div class="modal-content" >
				<div class="modal-header no-padding">
					<div class="table-header">
						<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
							<span class="white">&times;</span>
						</button>
						<span id='modalTitle'>历史告警统计</span>
					</div>
				</div>
				<br>
				<form id="sss" action="${ctx}/alarm/alarmprop/update" role="form" method="post">
<!-- 				  <table width="100%" style="border-collapse:collapse;border:1px #000000;"> -->
				  <table width="300" border="0" style="border-collapse:collapse;" cellpadding="0" cellspacing="0"> 
				  <tbody id="innerTr">
				    </tbody>
				  </table>
				</form>
			</div>
		</div>
	</div>
</body>



</html>
